<?php
/**
 * Demo get paypal amount balance
 */

require_once '../Paypal.php';

$username = 'gusde_1353959371_biz_api1.gmail.com';
$password = '1353959390';
$signature = 'A055WLid6SfE3ijP3zjTOpl90laLAenbcHgy4HWt1WJ-bhCGbr-bhfoF';

$Paypal = new Paypal($username, $password, $signature);
$Paypal->setEnvironment('sandbox');
$Paypal->addProduct('Barang 1', 200);
$Paypal->addProduct('Barang 2', 300, 2);

$returnUrl = 'http://success.host/'; // visitor redirect here if paid, you will get token and payerId
$cancelUrl = 'http://cancel.host/'; // visitor redirect here if paid, you will get token
$Paypal->reqExpressCheckout($returnUrl, $cancelUrl);

$redirectUrl = $Paypal->getExpressCheckoutUrl();
header('Location: '.$redirectUrl);
?>
